Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX]: Update ModemReporter #18

Merged
merged 1 commit into from
Jan 11, 2021
Merged

[BUG FIX]: Update ModemReporter #18

merged 1 commit into from
Jan 11, 2021

Conversation

erunks
Copy link
Owner

@erunks erunks commented Jan 11, 2021

What

There was a SQL error occurring during the reporting of modem events:

 ERROR: Unexpected error: <class 'mysql.connector.errors.ProgrammingError'>
Traceback (most recent call last):
  File "/home/pi/Code/internet-status-reporter/src/DatabaseInteractor.py", line 67, in execute_sql_with_commit
    cursor.execute(sql)
  File "/home/pi/.local/lib/python3.7/site-packages/mysql/connector/cursor.py", line 551, in execute
    self._handle_result(self._connection.cmd_query(stmt))
  File "/home/pi/.local/lib/python3.7/site-packages/mysql/connector/connection.py", line 490, in cmd_query
    result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
  File "/home/pi/.local/lib/python3.7/site-packages/mysql/connector/connection.py", line 395, in _handle_result
    raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Timing Synchronization failure - Failed to acquire FEC ..., 3, 2020-10-12 23:36:' at line 1

which wasn't able to be deduced until the recent addition of more logging, which showed the SQL that was actually attempted to be run. This PR should solve this issue.

Changes

  • Updated
    • value_string so the description and created_at values in the SQL string are properly surrounded in quotations
    • tests related to the change

@erunks erunks merged commit fffd3f4 into master Jan 11, 2021
@erunks erunks deleted the update-modem-reporting branch January 11, 2021 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant